import java.io.PrintWriter;
import java.io.FileOutputStream;
import java.io.FileNotFoundException;

public class txt_in_file
{
    public static void main(String[] args)
    {
         PrintWriter zzz = null;
         try
         {
              zzz = new PrintWriter(new FileOutputStream("F:/NetBeansProjects/STAT_GUI/out/DATA.txt"));
         }
         catch(FileNotFoundException e)
         {
             System.out.println("Ошибка открытия файла my_test_file.txt");
             System.exit(0);
         }

    zzz.println("It is program My9");
    zzz.println("_____");

System.out.println("It is program txt_in_file - record in file");

    int[] a1=new int[3];
    for (int i1=0;i1<a1.length;i1++)
        a1[i1]=i1*i1;
    for (int i1=0;i1<a1.length;i1++)
    zzz.println("|"+i1+"|"+a1[i1]+"|");
    zzz.println("_____");

    int a2[]={11,22,3,4,5,6,7};
    for (int i1=0;i1<a2.length;i1++)
    zzz.println("|"+i1+"|"+a2[i1]+"|");
    zzz.println("________");

    int[] a3=a2;
    a2[2]=100;
    a3[4]=300;
    for (int i1=0;i1<a3.length;i1++)
    zzz.println("|"+i1+"|"+a2[i1]+"|"+a3[i1]+"|");
    zzz.println("________");
             zzz.close();

         System.out.println("Программа завершена");
    }

}
/*
 public class My9
 {
     public static void main(String[] args)
     {
         PrintWriter zzz = null;
         try
         {
             zzz = new PrintWriter(new FileOutputStream("my_test_file.txt"));
         }
         catch(FileNotFoundException e)
         {
             System.out.println("Ошибка открытия файла my_test_file.txt");
             System.exit(0);
         }
         zzz.println("Это первая строка");
         zzz.println("Это вторая строка");

         zzz.close();

         System.out.println("Программа завершена");
     }
 }
 */